package pojo;
// Generated 16-giu-2013 19.52.47 by Hibernate Tools 3.2.1.GA


import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.UniqueConstraint;

/**
 * Rented generated by hbm2java
 */
@Entity
@Table(name="rented"
    ,catalog="mydb"
    , uniqueConstraints = @UniqueConstraint(columnNames="film_idfilm") 
)
public class Rented  implements java.io.Serializable {


     private Integer idrented;
     private User user;
     private Film film;
     private Date dayOfRent;

    public Rented() {
    }

    public Rented(User user, Film film, Date dayOfRent) {
       this.user = user;
       this.film = film;
       this.dayOfRent = dayOfRent;
    }
   
     @Id @GeneratedValue(strategy=IDENTITY)
    
    @Column(name="idrented", unique=true, nullable=false)
    public Integer getIdrented() {
        return this.idrented;
    }
    
    public void setIdrented(Integer idrented) {
        this.idrented = idrented;
    }
@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="user_iduser", nullable=false)
    public User getUser() {
        return this.user;
    }
    
    public void setUser(User user) {
        this.user = user;
    }
@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="film_idfilm", unique=true, nullable=false)
    public Film getFilm() {
        return this.film;
    }
    
    public void setFilm(Film film) {
        this.film = film;
    }
    @Temporal(TemporalType.DATE)
    @Column(name="day_of_rent", nullable=false, length=10)
    public Date getDayOfRent() {
        return this.dayOfRent;
    }
    
    public void setDayOfRent(Date dayOfRent) {
        this.dayOfRent = dayOfRent;
    }




}


